<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="/js/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="/js/easyui/themes/icon.css">
    <script type="text/javascript" src="/js/jquery.min.js"></script>
    <script type="text/javascript" src="/js/easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="/js/easyui/locale/easyui-lang-zh_CN.js"></script>
</head>
<body>
<form id="ff" method="post">
    <div>
        <tr>
            <td>查询类型bbb:</td>
            <td>
                <select class="easyui-combobox" name="id" style="width:200px;">
                    <option selected value="1">产权人</option>
                    <option value="2">身份ID</option>
                </select>
            </td>
            <td>
                <input type="text" name="query">
            </td>
        </tr>
        <a href="javascript:void(0);" data-method="search" class="easyui-linkbutton"
           iconCls="icon-search">搜索</a>
    </div>
</form>
<table id="recentHoust" class="easyui-datagrid" title="房产信息"
       data-options="singleSelect:true,collapsible:true, panelHeight:'auto',
       url:'/search'
       ">
    <thead>
    <!--<tr>
        <th data-options="field:'id',width:'10%'">编号</th>
        <th data-options="field:'propertyowner',align:'center',width:'15%'">项目名字</th>
        <th data-options="field:'projectname',width:'15%',align:'center'">产权人</th>
        <th data-options="field:'number',width:'15%',align:'center'">身份ID</th>
        <th data-options="field:'houstType',width:'15%',align:'center'">房屋类型</th>
        <th data-options="field:'square',width:'15%',align:'center'">使用面积</th>
        <th data-options="field:'builddata',width:'15%',align:'center'">建造时间</th>
    </tr>-->
        <tr>
            <th data-options="field:'id',width:'33%'">编号</th>
            <th data-options="field:'password',align:'center',width:'33%'">密码</th>
            <th data-options="field:'name',width:'34%',align:'center'">密码</th>
        </tr>
    </thead>
</table>

</body>
<script>
    $("a").on("click", function () {
        var methods = $(this).data("method");
        console.log(methods);
        if(methods){
            itsource[methods]();
        }
    });

    var ff = $("#ff");
    var recentHoust = $("#recentHoust");
    var itsource= {
        "search":function () {
            /* console.debug("search");*/
            //如果点击的是搜索提交from表单
            $('#ff').form("submit",{
                url:"/search",
                onSubmit: function(){
                    return true
                },
                success:function(data){
                    var data = $.parseJSON(data);
                    console.log("data"+data)
                    recentHoust.datagrid("loadData",data);
                }
            });
        }
    }
</script>
</html>